import fetch from '@system.fetch';

//请求地址
const URL="http://218.107.49.182:40837/WebAPI/App.ashx?"

function fetchRequest(paramModule,paramParam){
    const module="module"+paramModule
    const param="param="+escape(JSON.stringify(paramParam))
    let returnInfo=""
    fetch.fetch({
        url: URL+module+'&'+param,
        responseType: "json",
        success: res => {
            console.info("成功")
            returnInfo = JSON.parse(res)
        },
        fail: err => {
            console.info("失败" + JSON.stringify(err))
        },
        complete: v => {
            console.info("结束")
        }

    })
    return returnInfo
}

export default fetchRequest

/*

import fetch from '@system.fetch';

export default {
    data: {
        title: "",
        msg: "哈哈哈",
        formData:{
            "LoginID": "gzmdjlry1",
            "Password": "gzmd#001",
            "ZhuanYeId": 0,
            "PhoneIMEI": "01801A89A0AD4418F2A8A16C414BD73867622F06",
            "WorkPhone": "15000000001"
        },

    },
    onInit() {
        console.info("初始化")
        //请求地址
        const URL = "http://218.107.49.182:40837/WebAPI/App.ashx?"
        //请求标志
        const module="module=login"
        //请求参数
        const param="param="+escape(JSON.stringify(this.formData))

        fetch.fetch({
            url: URL+module+'&'+param,//拼接请求
            responseType: "json",
            success: res => {
                console.info("成功")
                console.info(JSON.stringify(res))
            },
            fail: err => {
                console.info("失败" + JSON.stringify(err))
            },
            complete: v => {
                console.info("结束")
            }
        })
    }
}
*/
